using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class Press_knowledgeMap : EntityTypeConfiguration<Press_knowledge>
    {
        public Press_knowledgeMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Locale)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.Headline_cs)
                .HasMaxLength(50);

            this.Property(t => t.Headline_en)
                .HasMaxLength(200);

            this.Property(t => t.Content_cs)
                .HasMaxLength(2500);

            this.Property(t => t.Content_en)
                .HasMaxLength(4000);

            // Table & Column Mappings
            this.ToTable("Press_knowledge");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Locale).HasColumnName("Locale");
            this.Property(t => t.Headline_cs).HasColumnName("Headline_cs");
            this.Property(t => t.Headline_en).HasColumnName("Headline_en");
            this.Property(t => t.Content_cs).HasColumnName("Content_cs");
            this.Property(t => t.Content_en).HasColumnName("Content_en");
            this.Property(t => t.Image_id).HasColumnName("Image_id");
            this.Property(t => t.Rank).HasColumnName("Rank");
            this.Property(t => t.Showrate).HasColumnName("Showrate");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
        }
    }
}
